home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8840 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.cis.nctu.edu.tw!usenet
  2. From: William Boyer <boyer.w@ghc.org>
  3. Newsgroups: comp.lang.apl,comp.lang.asm.x86,comp.lang.c,comp.lang.c++,comp.os.ms-windows.programmer.networks
  4. Subject: Re: API Call to Acquire Ethernet Address
  5. Date: Mon, 26 Feb 1996 16:10:25 -0800
  6. Organization: Group Health
  7. Message-ID: <31324BF1.68E5@ghc.org>
  8. References: <4f0bml$lvd@noc.tor.hookup.net> <4fnm1j$52@ns2.emirates.net.ae> <4gi2fg$bcq@news.hal.com> <4glnnu$bb3@dawn.mmm.com>
  9. NNTP-Posting-Host: @billy.ghc.org
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win95; I)
  14.  
  15. Aaron Luft wrote:
  16. > I use the NetBIOS get adapter status command passing a parameter of "*", it
  17. > takes all of ten lines of code or so, but you do have to have NetBIOS support.
  18. > I have done this with OS2, WIN NT, WFW, and DOS.  I have never done this on a
  19. > UNIX machine, but I think some do support NetBIOS.
  20. > Your other option (in DOS environments) is doing a "cheap" bind when the
  21. > device driver loads and make use of NDIS or OCX calls, but this is painful
  22. > (especially if all you need is a MAC address).
  23. > Opinions expressed herein are my own and may not represent those of 3M.
  24.  
  25. If you have the Netware VLM loaded, you can ask it. This is how I do it here.
  26.  
  27. int FAR PASCAL GetMacAddress(LPSTR pszMacAddr)
  28. {
  29.     union REGS regs;
  30.     int i = -1;
  31.  
  32.     regs.h.ah = 0xEE;
  33.     int86(0x21, ®s, ®s);
  34.     i = sprintf(pszMacAddr,"%0.4X%0.4X%0.4X",regs.x.cx, regs.x.bx, regs.x.ax);
  35.     return 0;
  36. }
  37.  
  38.  
  39. Bill Boyer
  40. Group Health
  41.